/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */

package com.windea.study.kotlin.fxgl.sample.basics

import com.almasb.fxgl.app.*
import com.almasb.fxgl.dsl.*
import com.almasb.fxgl.entity.*
import javafx.scene.paint.*
import javafx.scene.shape.*

/**
 * This is an example of a minimalistic FXGL game application.
 *
 * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com)
 */
class BasicGameSample : GameApplication() {
	private lateinit var player: Entity
	
	override fun initSettings(settings: GameSettings) {
		settings.width = 800
		settings.height = 600
		settings.title = "BasicGameSample"
	}
	
	override fun initGame() {
		player = entityBuilder()
			.at(150.0, 150.0) //指定生成的位置
			.view(Rectangle(40.0, 40.0, Color.BLUE)) //指定生成的视图大小和形状
			.buildAndAttach() //构建视图并添加到游戏世界
	}
}

fun main(args: Array<String>) {
	GameApplication.launch(BasicGameSample::class.java, args)
}
